<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--第一步，导入Vue.js-->
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
</head>
<body>

<!--view层 模板-->
<div id="app">

    <button v-on:click="sayHi">点击我</button>
</div>

<script>
    var vm = new Vue({
        el:"#app",
        //Model:数据
        data:{
            message: "狂神说"
        },
        methods:{//方法必须定义在Vue的methods对象中,v-on:事件
            sayHi: function (event) {
                alert(this.message);
            }
        }
    });
</script>
</body>
</html>